package com.xthink.web.controller;

import com.xthink.common.result.AjaxResult;
import com.xthink.common.pojo.polo.PoolPackage;
import com.xthink.common.vo.pool.LikeListPoolPackageVo;
import com.xthink.web.service.PoolPackageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/poolPackage")
public class PoolPackageController {
    @Autowired
    private PoolPackageService poolPackageService;

    //新建池套餐
    @PostMapping("/insertPoolPackage")
    public AjaxResult insertPoolPackage(@RequestBody PoolPackage poolPackage){
        return poolPackageService.insertPoolPackage(poolPackage);
    }

    //模糊搜索及分页查询
    @PostMapping("/likeListPoolPackage")
    public AjaxResult likeListPoolPackage(@RequestBody LikeListPoolPackageVo likeListPoolPackageVo){
        return poolPackageService.likeListPoolPackage(likeListPoolPackageVo);
    }

    //上架池套餐
    @GetMapping("/poolPackagePutOn/{ids}")
    public AjaxResult poolPackagePutOn(@PathVariable("ids")Integer[] ids){
        return poolPackageService.poolPackagePutOn(ids);
    }

    //下架池套餐
    @GetMapping("/poolPackageOff/{ids}")
    public AjaxResult poolPackageOff(@PathVariable("ids")Integer[] ids){
        return poolPackageService.poolPackageOff(ids);
    }

    //删除池套餐
    @GetMapping("/poolPackageDelete/{ids}")
    public AjaxResult poolPackageDelete(@PathVariable("ids")Integer[] ids){
        return poolPackageService.poolPackageDelete(ids);
    }

    //编辑池套餐
    @GetMapping("/poolPackageUpdate")
    public AjaxResult poolPackageUpdate(@RequestBody PoolPackage poolPackage){
        return poolPackageService.poolPackageUpdate(poolPackage);
    }
}
